import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    redirect: "/index",
    meta: {
      title: "首页"
    },
    component: () => import("../views/Home.vue"),
    children: [
      /******* 网站管理模块 *******/
      {
        // 首页
        path: "index",
        name: "Index",
        component: () => import("../views/Index/Index.vue")
      },
      {
        // 站点信息
        path: "/website",
        name: "Website",
        meta: {
          title: "站点信息"
        },
        component: () => import("../views/WebSite/Add.vue")
      },
      {
        // 广告管理
        path: "/adv",
        name: "Adv",
        meta: {
          title: "库存列表"
        },
        component: () => import("../views/Article/List.vue")
      },

      /******* 文章模块 *******/
      {
        // 文章列表
        path: "/article/list",
        name: "ArticleList",
        meta: {
          title: "文章列表"
        },
        component: () => import("../views/Article/List.vue")
      },
      {
        // 分类管理
        path: "/article/cate",
        name: "ArticleCate",
        meta: {
          title: "分类管理"
        },
        component: () => import("../views/Cate/List.vue")
      },
      {
        // 标签管理
        path: "/article/tag",
        name: "ArticlTag",
        meta: {
          title: "标签管理"
        },
        component: () => import("../views/Tag/List.vue")
      },
      {
        // 文章回收站
        path: "/article/recycled",
        name: "ArticleRecycled",
        meta: {
          title: "文章回收站"
        },
        component: () => import("../views/Article/Recycled.vue")
      },
      {
        // 添加文章
        path: "/article/add",
        name: "ArticleAdd",
        meta: {
          title: "添加文章"
        },
        component: () => import("../views/Article/Add.vue")
      },

      /******* 其他模块 *******/
      {
        // 友情链接
        path: "/blogroll",
        name: "Blogroll",
        meta: {
          title: "友情链接"
        },
        component: () => import("../views/Article/List.vue")
      },
      {
        // 留言列表
        path: "/message",
        name: "Message",
        meta: {
          title: "留言列表"
        },
        component: () => import("../views/Article/List.vue")
      },
      {
        // 博主信息
        path: "/blogger",
        name: "Blogger",
        meta: {
          title: "博主信息"
        },
        component: () => import("../views/Article/List.vue")
      },
      {
        // 博客信息
        path: "/blogs",
        name: "Blogs",
        meta: {
          title: "博客信息"
        },
        component: () => import("../views/Article/List.vue")
      }

      /******* 会员模块 *******/
      // {
      //   // 正常会员列表
      //   path: '/users/list',
      //   name: 'UsersList',
      //   meta: {
      //     title: '会员列表'
      //   },
      //   component: () => import("../views/Article/List.vue")
      // },

      // {
      //   // 禁言会员列表
      //   path: '/users/silent',
      //   name: 'UsersSilent',
      //   meta: {
      //     title: '禁言会员'
      //   },
      //   component: () => import("../views/Article/List.vue")
      // },

      // {
      //   // 冻结会员列表
      //   path: '/users/freeze',
      //   name: 'UsersFreeze',
      //   meta: {
      //     title: '冻结会员'
      //   },
      //   component: () => import("../views/Article/List.vue")
      // },
    ]
  },
  {
    // 登录页
    path: "/login",
    name: "Login",
    component: () => import("../views/Login/Index.vue")
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
